package com.ruoyi.quartz.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quartz.mapper.YongyouCprkMapper;
import com.ruoyi.quartz.domain.YongyouCprk;
import com.ruoyi.quartz.service.IYongyouCprkService;

/**
 * 产品入库Service业务层处理
 * 
 * @author SYF
 * @date 2025-04-17
 */
@Service
public class YongyouCprkServiceImpl implements IYongyouCprkService 
{
    @Autowired
    private YongyouCprkMapper yongyouCprkMapper;

    /**
     * 查询产品入库
     * 
     * @param vouchdate 产品入库主键
     * @return 产品入库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public YongyouCprk selectYongyouCprkByVouchdate(String vouchdate)
    {
        return yongyouCprkMapper.selectYongyouCprkByVouchdate(vouchdate);
    }

    /**
     * 查询产品入库列表
     * 
     * @param yongyouCprk 产品入库
     * @return 产品入库
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<YongyouCprk> selectYongyouCprkList(YongyouCprk yongyouCprk)
    {
        return yongyouCprkMapper.selectYongyouCprkList(yongyouCprk);
    }

    /**
     * 新增产品入库
     * 
     * @param yongyouCprk 产品入库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertYongyouCprk(YongyouCprk yongyouCprk)
    {
        return yongyouCprkMapper.insertYongyouCprk(yongyouCprk);
    }

    /**
     * 修改产品入库
     * 
     * @param yongyouCprk 产品入库
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateYongyouCprk(YongyouCprk yongyouCprk)
    {
        return yongyouCprkMapper.updateYongyouCprk(yongyouCprk);
    }

    /**
     * 批量删除产品入库
     * 
     * @param vouchdates 需要删除的产品入库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCprkByVouchdates(String[] vouchdates)
    {
        return yongyouCprkMapper.deleteYongyouCprkByVouchdates(vouchdates);
    }

    /**
     * 删除产品入库信息
     * 
     * @param vouchdate 产品入库主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCprkByVouchdate(String vouchdate)
    {
        return yongyouCprkMapper.deleteYongyouCprkByVouchdate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteYongyouCprkByDate(String vouchdate)
    {
        return yongyouCprkMapper.deleteYongyouCprkByDate(vouchdate);
    }

    @Override
    @DataSource(DataSourceType.SLAVE)
    public int clearCprk(){
        return yongyouCprkMapper.clearCprk();
    }
}
